home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr27 / gs26.zip / SHOWCHAR.PS < prev    next >
Text File  |  1993-04-05  |  3KB  |  90 lines

  1. %    Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2. %    Distributed by Free Software Foundation, Inc.
  3. %
  4. % This file is part of Ghostscript.
  5. %
  6. % Ghostscript is distributed in the hope that it will be useful, but
  7. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. % to anyone for the consequences of using it or for whether it serves any
  9. % particular purpose or works at all, unless he says so in writing.  Refer
  10. % to the Ghostscript General Public License for full details.
  11. %
  12. % Everyone is granted permission to copy, modify and redistribute
  13. % Ghostscript, but only under the conditions described in the Ghostscript
  14. % General Public License.  A copy of this license is supposed to have been
  15. % given to you along with Ghostscript so you can know your rights and
  16. % responsibilities.  It should be in a file named COPYING.  Among other
  17. % things, the copyright notice and this notice must be preserved on all
  18. % copies.
  19.  
  20. % showchar.ps
  21. % Show the outline and rasterized forms of a character.
  22.  
  23. /F /Palatino-Roman def
  24. /P 8 def
  25. /Rx 360 def
  26. /Ry 360 def
  27. /Cs (T) def
  28. /Delay 0 def
  29.  
  30. 0 setgray
  31. (markpath.ps) run
  32. /mmx [1 0 0 1 0 0] def
  33. /getpath        % - getpath <pathproc>
  34.  { [
  35.     { /moveto cvx } { /lineto cvx } { /curveto cvx } { /closepath cvx }
  36.    pathforall
  37.    ] cvx
  38.  } def
  39. /bitselectfont        % <fontname> <scale> bitselectfont -
  40.  { exch findfont exch scalefont setfont
  41.     % Compute the bounding box in device coordinates.
  42.    gsave [Rx 72 div 0 0 Ry 72 div 0 0] setmatrix
  43.    currentfont /FontMatrix get concat
  44.    currentfont /FontBBox get aload pop
  45.    transform ceiling cvi /ury exch def ceiling cvi /urx exch def
  46.    transform floor cvi /lly exch def floor cvi /llx exch def
  47.    /bbx urx llx sub def /bby ury lly sub def
  48.    grestore
  49.  } def
  50. /bitshow        % <string> bitshow -
  51.  { /S exch def gsave
  52.    /W bbx 8 add 7 or 1 add def
  53.    /H bby 8 add def
  54.    /buf W 8 idiv string def
  55.    /M [Rx 72 div 0 0 Ry -72 div 4 llx sub H 4 sub] def
  56.    M W H <ff 00> makeimagedevice
  57.    /dev exch def
  58.    gsave dev setdevice
  59.    newpath 0 lly idtransform moveto
  60.    0 setgray
  61.    gsave
  62.      /hpath S false charpath getpath def
  63.    grestore
  64.    gsave 0.0001 rotate
  65.      /npath S false charpath getpath def
  66.    grestore
  67.    S show grestore
  68.    20 20 translate
  69.    150000 Rx Ry max P mul div dup scale
  70.    0.7 setgray
  71.    0 W H true M
  72.     { dup 1 add exch dev exch buf copyscanlines
  73.     } imagemask pop
  74.    0 setlinewidth
  75.    gsave 0 setgray hpath exec mmx markpath grestore
  76.    1 0 0 setrgbcolor hpath exec stroke
  77.    gsave 0 setgray npath exec mmx markpath grestore
  78.    0 1 0 setrgbcolor npath exec stroke
  79.  } def
  80. F P bitselectfont
  81. /S1 1 string def
  82. Cs
  83.  { /C exch def
  84.    currentfont /Encoding get C get /.notdef ne
  85.     { save S1 0 C put S1 bitshow
  86.       showpage restore
  87.     } if
  88.  } forall
  89. quit
  90.